import { request } from '../utils/request'
// 首页
export const getIndexList = (data) => {
  return request({
    url: '/Alipay/Index/index',
    method: 'GET',
    data
  })
}
// 首页商品推荐分类列表
export const getCategoryTitle = (data) => {
  return request({
    url: '/Alipay/Index/categoryList',
    method: 'GET',
    data
  })
}
// 首页商品推荐列表
export const getIndexRecomList = (data) => {
  return request({
    url: '/Alipay/Index/indexList',
    method: 'GET',
    data
  })
}
// 商品详情
export const getGoodsInfo = (data) => {
  return request({
    url: '/Alipay/Goods/getGoodsInfo',
    method: 'GET',
    data
  })
}
// 获取分类
export const getCategory = (data) => {
  return request({
    url: '/Alipay/Goods/getCategory',
    method: 'GET',
    data
  })
}
// 商品列表页
export const getGoodsList = (data) => {
  return request({
    url: '/Alipay/Goods/getGoodsList',
    method: 'POST',
    data
  })
}
// 商品参数
export const getGoodsParameter = (goods_id) => {
  return request({
    url: '/Alipay/Goods/getGoodsParameter',
    method: 'GET',
    data: { goods_id }
  })
}
// 获取套餐信息
export const getGoodsSetmeal = (goods_id) => {
  return request({
    url: '/Alipay/Goods/getGoodsSetmeal',
    method: 'GET',
    data: { goods_id }
  })
}
// 静默和主动授权
export const grantAuth = (data) => {
  return request({
    url: '/Alipay/Auth/grantAuth',
    method: 'POST',
    data
  })
}
// 确认订单
export const confirmOrder = (data) => {
  return request({
    url: '/Alipay/Order/confirmOrder',
    method: 'POST',
    data
  })
}
// 生成订单
  export  const makeOrder = (data) => {
  return request({
    url: '/Alipay/Order/makeOrder',
    method: 'POST',
    data
  })
}

// 获取收藏列表
export const getCollection = (data) => {
  return request({
    url: '/Alipay/Centre/getCollection',
    method: 'GET',
    data
  })
}

// 删除收藏
export const delCollection = (id) => {
  return request({
    url: '/Alipay/Centre/delCollection',
    method: 'POST',
    data: { id }
  })
}

// 获取订单租期详情
export const getOrderLeaseTerm = (data) => {
  return request({
    url: '/Alipay/Order/getOrderLeaseTerm',
    method: 'POST',
    data
  })
}
// 商品详情添加收藏
export const addCollection = (goods_id) => {
  return request({
    url: '/Alipay/Centre/addCollection',
    method: 'POST',
    data: { goods_id }
  })
}
// 商品详情删除收藏
export const delCollectionByGoodsId = (goods_id) => {
  return request({
    url: '/Alipay/Centre/delCollectionByGoodsId',
    method: 'POST',
    data: { goods_id }
  })
}
// 检测商品是否收藏
export const checkCollection = (goods_id) => {
  return request({
    url: '/Alipay/Centre/checkCollection',
    method: 'GET',
    data: { goods_id }
  })
}
// 授权手机号
export const grantAuthMobile = (mobileStr) => {
  return request({
    url: '/Alipay/Auth/grantAuthMobile',
    method: 'POST',
    data: { mobileStr }
  })
}
// 实人认证获取数据
export const getPersonAuth = () => {
  return request({
    url: '/Alipay/Auth/getPersonAuth',
    method: 'POST'
  })
}
// 唤起实人认证
export const getOcr = (data) => {
  return request({
    url: '/Alipay/Auth/getOcr',
    method: 'POST',
    data
  })
}
// ocr
export const realPersonAuth = (data) => {
  return request({
    url: '/Alipay/Auth/realPersonAuth',
    method: 'POST',
    data
  })
}
// 实人认证结果查询
export const checkPersonAuth = (certifyId) => {
  return request({
    url: '/Alipay/Auth/checkPersonAuth',
    method: 'POST',
    data: { certifyId }
  })
}
// 唤起预授权
export const createPreAuth = (order_id) => {
  return request({
    url: '/Alipay/Order/createPreAuth',
    method: 'POST',
    data: { order_id }
  })
}
// 创建签署合同
export const createContract = (order_id) => {

  return request({
    url: '/Alipay/Order/createContract',
    method: 'POST',
    data: { order_id }
  })
}
// 花呗支付
export const createHuabei = (order_id) => {
  return request({
    url: '/Alipay/Order/createHuabei',
    method: 'POST',
    data: { order_id }
  })
}
// 供应商申请
export const supplierApply = (data) => {
  return request({
    url: '/Alipay/Shop/supplierApply',
    method: 'POST',
    data
  })
}
// 供应商添加数据获取
export const getSupplierData = () => {
  return request({
    url: '/Alipay/Shop/getSupplierData',
    method: 'GET'
  })
}
// 获取常见问题分类
export const getCommonProblemType = () => {
  return request({
    url: '/Alipay/Help/getCommonProblemType',
    method: 'GET',
    data: { type_name: '常见问题' }
  })
}
// 获取常见问题
export const getCommonProblemById = (id) => {
  return request({
    url: '/Alipay/Help/getCommonProblemById',
    method: 'GET',
    data: { id }
  })
}
// 获取省市区信息
export const getGoodsAreas = () => {
  return request({
    url: '/Supplier/Currency/getRegion',
    method: 'GET'
  })
}
// 获取租赁协议
export const getAgreement = () => {
  return request({
    url: '/Alipay/Help/getAgreement',
    method: 'GET'
  })
}
// 获取授权协议
export const getAuthAgreement = () => {
  return request({
    url: '/Alipay/Help/getAuthAgreement',
    method: 'GET'
  })
}
// 获取隐私政策
export const getPrivacy = () => {
  return request({
    url: '/Alipay/Help/getPrivacy',
    method: 'GET'
  })
}
// 交易快照
export const orderSnapshot = (order_id) => {
  return request({
    url: '/Alipay/Order/orderTransSnapshot',
    method: 'GET',
    data: { order_id }
  })
}
// 创建智能合同
export const createAntchain = (order_id) => {
  return request({
    url: '/Alipay/Antchain/createAntchain',
    method: 'POST',
    data: { order_id }
  })
}
// 下单智能合同中转页面，获取用户实名认证信息
export const getAuthentic = (order_id) => {
  return request({
    url: '/Alipay/Auth/getAuthentic',
    method: 'POST',
    data: { order_id }
  })
}
